package com.lfy.spring.service.impl;

import com.lfy.spring.dao.UserDao;
import com.lfy.spring.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Service;

import java.util.Locale;

/**
 * @author leifengyang
 * @version 1.0
 * @date 2025/8/9 20:15
 * @description:
 */
//@Import(Locale.class)
@Service
public class UserServiceImpl implements UserService {


    UserDao userDao;


    //只写一个有参构造器；
    //Spring默认把构造器中的所有参数从容器中获取并赋值过来
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }


    @Override
    public void printUser(int a,int b) {
        System.out.println("hello");
//        int i = 10/0;
        userDao.helloUser();
    }

    @Override
    public int helloAbc(int a) {
        int x = a+1;
        System.out.println("计算结果："+x);
        return x;
    }
}
